public class ThreadGroupDemo2{
	public static void main(Sting [] args){
		ThreadGroup group = new ThreadGroup("group");

		Thread thread = new Thread(group,()->{
			throw new RuntimeExpection("thread1 测试除外”);
		});
		thread1.setUncaughtExpectionHandlder((thread,throwable)->{
			System.out.printf("%s%n",thread.getName(),throwable.getmessage());
		});
		Thread thread2 = new Thread(group,() —>{
			throw new RuntimeExpection("thread 测试异常“）;
				});


		thread1.start();
		thread2.start();
	}
}

